#include <stdio.h>
#include <string.h>

int strNumSum(const char * str,int length)
{
    int sum = 0;
    for(int idx = 0;idx < length;idx++)
    {
        if(str[idx] >= '0' &&str[idx] <= '9')
        {
            sum +=str[idx]-'0';
        }
    }
    return sum;
}

int main()
{
    char str[] ="sq3124wd2sew421";
    int length =strlen(str);
    int sum = strNumSum(str,length);
    printf("%d\n",sum);

}